package com.oktest.measure.media.video.adapter

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.oktest.measure.R
import com.oktest.measure.media.video.VideoItem
import kotlinx.android.synthetic.main.media_grid_item.view.*

/**
 * @Author hhh
 * @Date 2020/10/27
 */
class MultiGridAddAdapter(val items :ArrayList<VideoItem>)
    :BaseMultiItemQuickAdapter<VideoItem, BaseViewHolder>(items) {

    init {
        addItemType(VideoItem.TYPE_ADD, R.layout.media_grid_add)
        addItemType(VideoItem.TYPE_ITEM, R.layout.media_grid_item)

    }

    override fun convert(holder: BaseViewHolder, item: VideoItem) {
        holder.itemView.apply {
            if (item.itemType == VideoItem.TYPE_ITEM) {
                ivBitmap.setImageBitmap(item.bitmap)
            }
        }
    }

}